public class Sushu {
    public static boolean is素数(int n){
        for (int i = 2; i < n; i++){
            if(n % i == 0){
                return  false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        int count = 0;
        for (int i = 2; i <= 1000; i++){
            if (is素数(i)){
                System.out.println(i +" ");
                count++;
                if (count == 10){
                    System.out.println();
                    count = 0;
                }
            }
        }
    }
}
